package cn.edu.swu.dlx;

import java.util.Date;

public class Book {

    private int id;
    private String name;
    private String author;
    private double price;
    private Date publish;

    public Book() {
    }

    public Book(int id, String name, String author, double price, Date publish) {
        this.id = id;
        this.name = name;
        this.author = author;
        this.price = price;
        this.publish = publish;
    }


    // 提供setter方法
    public void setId(int id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public void setPublish(Date publish) {
        this.publish = publish;
    }

    // 提供getter方法
    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getAuthor() {
        return author;
    }

    public double getPrice() {
        return price;
    }

    public Date getPublish() {
        return publish;
    }

    @Override
    public String toString() {
        return "Book [id=" + id + ", name=" + name + ", author=" + author + ", price=" + price + ", publishDate="
                + publish + "]";
    }



}
